Skip to content

Issues when using a SQLite database with Flex? #129

@javiereguiluz

Description

@javiereguiluz

Note: I don't know if this caused by Doctrine DBAL, DoctrineBundle, Symfony or Flex, but I can use SQLite with Doctrine + Symfony 3.3, but I can't with Doctrine + Symfony 3.3 + Flex. That's why I open this issue here.


Create a project:

$ composer create symfony/skeleton my-project
$ cd my-project/
$ composer require doctrine

Configure a SQLite database using the same syntax suggested by Flex:

# .env
###> doctrine/doctrine-bundle ###
DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
###< doctrine/doctrine-bundle ###

Try to create the database:

$ ./bin/console doctrine:database:create

Then you see this error:

Could not create database %kernel.project_dir%/var/data.db for connection named default
An exception occured in driver: SQLSTATE[HY000] [14] unable to open database file

The same error happened to me in other projects using Flex (maybe it's caused by .env + DotEnv?) because I use SQLite databases in functional tests (and they work in Symfony 3.3 without Flex).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions